package com.hjl.spring6.aop.annoaop;

import org.springframework.stereotype.Component;

/**
 * @author ServivE
 * @version 0.1
 * @className CalculatorLogImpl
 * @description
 * @date 2024/8/7 11:41
 * @since jdk11
 */
//基本实现类
@Component
public class CalculatorImpl implements Calculator {

    @Override
    public int add(int i, int j) {

        int result = i + j;
//        int a = 1 / 0;

        System.out.println("方法内部 result = " + result);

        return result;
    }

    @Override
    public int sub(int i, int j) {

        int result = i - j;

        System.out.println("方法内部 result = " + result);

        return result;
    }

    @Override
    public int mul(int i, int j) {

        int result = i * j;

        System.out.println("方法内部 result = " + result);

        return result;
    }

    @Override
    public int div(int i, int j) {

        int result = i / j;

        System.out.println("方法内部 result = " + result);

        return result;
    }
}
